package com.qyhl.module_home.new_message.detail;


import com.qyhl.webtv.commonlib.entity.config.MessageDetailBean;

import java.util.List;

public class MessageDetailPresenter implements MessageDetailContract.MessageDetailPresenter {
    private MessageDetailModel mModel;
    private MessageDetailActivity mView;

    MessageDetailPresenter(MessageDetailActivity mView) {
        this.mView = mView;
        this.mModel = new MessageDetailModel(this);
    }

    @Override
    public void getMessageList(String phone, String time, String msgId, String type) {
        mModel.getMessageList(phone, time, msgId, type);
    }

    @Override
    public void setMessageList(List<MessageDetailBean> beanList, boolean isMore) {
        mView.setMessageList(beanList, isMore);
    }

    @Override
    public void setError(int code, String msg) {
        switch (code) {
            case 0:
                mView.setNetError(msg, false);
                break;
            case 1:
                mView.setNetError(msg, true);
                break;
            case 2:
                mView.setEmpty(msg, false);
                break;
            case 3:
                mView.setEmpty(msg, true);
                break;
            case 4:
                mView.setError(msg, false);
                break;
            case 5:
                mView.setError(msg, true);
                break;
        }
    }
}
